/*
 * @Author: boyyang
 * @Date: 2022-01-05 17:01:53
 * @LastEditTime: 2022-01-07 11:09:14
 * @LastEditors: boyyang
 * @Description: 
 * @FilePath: \boyyang\src\components\message\messageType.ts
 */


import { InjectionKey } from 'vue'

export enum Direction {
    'top',
    'bottom',
    'left',
    'right'
}

export interface IMessageOption {
    icon?: string; //图标
    isClose?: boolean; //是否显示关闭icon
    duration?: number; //持续时间
}

export interface IMessageProviderProps {
    max?: number
}

export interface IMessageApi {
    info: (message: string, option?: IMessageOption) => void;
    success: (message: string, option?: IMessageOption) => void;
    error: (message: string, option?: IMessageOption) => void;
    warning: (message: string, option?: IMessageOption) => void;
}


export interface IMessageCreate {
    message: string;
    options?: IMessageContent,
    type: string
}

export interface IMessageContent extends IMessageOption {
    type?: string;
    msg?: string | number;
    id?: string
}

export const providerKey: InjectionKey<IMessageApi> = Symbol('providerKey')

